

package com.hazelcast.query.impl.predicates;

import com.hazelcast.internal.serialization.BinaryInterface;
import com.hazelcast.query.impl.QueryContext;
import com.hazelcast.query.impl.QueryableEntry;

import java.util.Set;
import java.util.regex.Pattern;

/**
 * Ilike Predicate
 */
@BinaryInterface
public class ILikePredicate extends LikePredicate {

    public ILikePredicate() {
    }

    public ILikePredicate(String attribute, String second) {
        super(attribute, second);
    }

    @Override
    public Set<QueryableEntry> filter(QueryContext queryContext) {
        return null;
    }

    @Override
    public boolean isIndexed(QueryContext queryContext) {
        return false;
    }

    @Override
    public String toString() {
        return attributeName + " ILIKE '" + expression + "'";
    }

    @Override
    protected int getFlags() {
        return super.getFlags() | Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE;
    }

    @Override
    public int getClassId() {
        return PredicateDataSerializerHook.ILIKE_PREDICATE;
    }
}
